<template>
	<view class="container">
		<view class="but" @click="next(1)">
			<image src="../../static/images/zhijian.gif" mode="" class="zdlogo"></image>
			指尖光环
		</view>
		<view class="but" @click="next(2)">
			<image src="../../static/images/zhenxinhua.png" mode="" class="zdlogo"></image>
			真心话大冒险
		</view>
		<view class="but" @click="next(3)">
			<image src="../../static/images/qqq.gif" mode="" class="zdlogo"></image>
			指尖大冒险
		</view>
		<view class="but" @click="next(4)">
			<image src="../../static/images/zdlogo.gif" mode="" class="zdlogo"></image>
			数字炸弹
		</view>
		<view class="but" @click="next(5)">
			<image src="../../static/images/jiejie.png" mode="" class="zdlogo"></image>
			随机小姐姐
		</view>
		<view class="but" @click="next(7)">
			<image src="../../static/images/jiejie.png" mode="" class="zdlogo"></image>
			漫画大全
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
			
			}
		},
		onLoad() {
		uni.getPrivacySetting({
		      success: res => {
		        console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
		        if (res.needAuthorization) {
		          // 需要弹出隐私协议
		         console.log(res)
		        } else {
		          // 用户已经同意过隐私协议，所以不需要再弹出隐私协议，也能调用隐私接口
		        }
		      },
		      fail: () => {},
		      complete: () => {}
		    })
			
		},
		onShareAppMessage(e) {
			let shareobj = {
				title: '好哥哥的小程序',
				path: '/pages/index/index', 
			}
			return shareobj //一定要返回对象
		},
		methods: {
			next(next) {
				switch (next) {
					case 1:
						uni.navigateTo({
							url: '/subPackages/zhijian/index'
						})
						break;
					case 2:
						uni.navigateTo({
							url: '/subPackages/damaoxian/index'
						})
						break;
					case 3:
						uni.navigateTo({
							url: '/subPackages/hensive/index'
						})
						break;
					case 4:
						uni.navigateTo({
							url: '/subPackages/zhadan/index'
						})
						break;
					case 5:
						uni.navigateTo({
							url: '/subPackages/jiejielist/index'
						})
						break;
					case 6:
						uni.navigateTo({
							url: '/subPackages/jiejie2/index'
						})
						break;
					case 7:
						uni.navigateTo({
							url: '/subPackages/cartoon/index'
						})
						break;
				} 
			}
		}
	}
</script>

<style lang="scss" scoped>
	/**index.wxss**/

	.container {
		height: 100vh;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		background: url();
		background-size: 100% 100% !important;
		position: relative;
		padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS 设备 */
		padding-bottom: env(safe-area-inset-bottom); /* 兼容 iPhone X 及以上设备 */
		.but {
			flex: 1;
			display: flex;
			flex-direction: column;
			align-items: center;
			text-align: center;
			justify-content: space-around;
			margin-bottom: 50rpx;

			.zdlogo {
				width: 200rpx;
				height: 200rpx;
				margin-bottom: 20rpx;
			}
		}
	}
</style>